package com.itheima.d6_singleInstance.repeatPractice.lazySingleINstance;

import com.itheima.d6_singleInstance.repeatPractice.hungrySingleInstance.Friend;

public class Friend2 {
    private String name;

    private static Friend2 friend2;

    private Friend2() {
        name = "兮";
    }

    public static Friend2 getInstance() {
        if (friend2 == null) {
            friend2 = new Friend2();
        }
        return friend2;
    }

    public void show() {
        System.out.println("我的朋友是：" + name);
    }
}
